Component({
  data: {
    selected: 0,
    color: "#000",
    roleId: '',
    selectedColor: "#00CCCC",
    allList: [{


      list1: [ {
        "pagePath":"/pages/order/order",
        "text":"我的订单",
        "iconPath": "/image/order.png",
         "selectedIconPath": "/image/order-select.png"
      },
      {
        "pagePath":"/pages/piece/piece",
        "text":"定片",
        "iconPath": "/image/placeOrder.png",
        "selectedIconPath": "/image/placeOrder-select.png"
      },
      {
        "pagePath":"/pages/my/my",
        "text":"我的",
        "iconPath": "/image/my.png",
        "selectedIconPath": "/image/my-select.png"
      }],



      list2: [{
        "pagePath":"/pages/eHome/eHome",
        "text":"员工主页",
        "iconPath": "/image/order.png",
         "selectedIconPath": "/image/order-select.png"
      },
      {
        "pagePath":"/pages/piece/piece",
        "text":"定片",
        "iconPath": "/image/placeOrder.png",
        "selectedIconPath": "/image/placeOrder-select.png"
      },
      {
        "pagePath":"/pages/my/my",
        "text":"我的",
        "iconPath": "/image/my.png",
        "selectedIconPath": "/image/my-select.png"
      }],

     
    }],
    list: []
  },
  attached() {
    this.setData({
      list: this.data.allList[0].list2,
      selected:3
    })
    // const roleId = wx.getStorageSync('role')
    // if (roleId !== 2) {
    //   this.setData({
    //     list: this.data.allList[0].list2
    //   })
    // }else {
    //   this.setData({
    //     list: this.data.allList[0].list1
    //   })
    // }
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({ url })
      this.setData({
        selected: data.index
      })
    }
  },
  
  
  //selected: 0就是选中的tabbar下标，根据不同页面显示不同tabbar下标
  
  



})


